package com.rowline.admin.module.study.jdknewfeature;

/**
 * ClassName:PersonFactory
 * Created by 245167
 * on 2018/5/4  04:36
 * description:
 */
public interface PersonFactory<P extends Person> {

//    P create(String name,int age);

    P create();

    public static void main(String[] args) {

        PersonFactory<Person> personFactory = Person::new;

//        Person person1 = personFactory.create("Peter",12);
//        System.out.println(person1);

        Person person2 = personFactory.create();
        System.out.println(person2);

    }
}
